﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Engine.NetClasses
{
    [StructLayout(LayoutKind.Sequential, Pack = 1)]
    public struct HeaderPacket
    {
        public short _psize;
        public byte _ptype;
        public PacketType TypePacket
        {
            get
            {
                PacketType typeP=PacketType.NullPacket;
                if (Enum.TryParse<PacketType>(_ptype.ToString(),out typeP))
                {
                    return typeP;
                }
                else
                {
                    return PacketType.NullPacket;
                }
            }

        }
    }

}
